-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more validation for posting maintenance tasks #2757
Add more validation for posting maintenance tasks #2757
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2757 +/- ##
==========================================
+ Coverage 55.66% 56.04% +0.37%
==========================================
Files 567 567
Lines 41224 41250 +26
==========================================
+ Hits 22946 23117 +171
+ Misses 18278 18133 -145 ☔ View full report in Codecov by Sentry. |
I have now updated it to handle both component keys that are not of type int and handling of given keys where there are no components for those keys. Currently it still shows at "Selected components" an entry with a "(Component was deleted)", if I should also remove that, let me know, I just wanted to get this out now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should really make an issue out of adding proper form handling to this (I believe this code predates Django in NAV, which is why it's so weird).
I have only one nitpick with your solution (which looks much better now, given the circumstances):
The error messages are "tech-speak-laden", i.e. at minimum, the term pks
needs to be expanded to either "primary keys" or perhaps just "identifiers".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
squash squash squash ⏩
508428d
to
dba746a
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Catches posting maintenance tasks with invalid netbox keys as well as posting maintenance tasks with end time before start time.
Also adds tests for those cases.